import Mock from "mockjs";
const Random = Mock.Random
let Result = {
    code: 200,
    msg: "操作成功",
    data: null
}
let randNum = []
for (let i = 0; i < 5; i++) {
    randNum.push(Math.floor(Math.random() * 9) + 1)
}
let aaa=randNum.join("")
// 随机图片地址
Mock.mock("/captcha", "get", () => {
    Result.data = {
        
        token: Random.string(32),
        captchaImg: Random.dataImage("120x40", aaa),
    }
    return Result
})
// 登录请求路径
Mock.mock("/login", "post", () => {
    Result.code=200
    Result.msg="验证错误"
    return Result
})

// 登录用户路径
Mock.mock("/sys/userinfo", "get", () => {
    Result.data = {
        id: "1",
        username: "蜡笔小新",
        avatar: "http://localhost:8080/img/erweima.b2246178.jpg",
    }
    return Result
})

// 请求退出路径
Mock.mock("/logout", "post", () => {
    
    return Result
})
